<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>推荐的事件处理方式</title>
</head>
<body>
    <button>点我</button>
    
</body>
<script>
    let btn = document.querySelector('button');
     function fun1(){

     }
     btn.addEventListener('click',fun1);
     btn.removeEventListener('click',fun1);



    btn.addEventListener('click',function(e){
        console.log(e);
        
        alert('这是推荐使用方式1');
    });
    btn.addEventListener('click',function(){
        alert('这是推荐使用方式2');
    });

</script>
</html>
